package BeanUtils.T2;

import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

public class T2 {

    public static void main(String[] args) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {

        Phone p = new Phone("华为P30pro","白色",5999,"6.47");

        String name = BeanUtils.getProperty(p, "brand");
        String color = BeanUtils.getProperty(p, "color");
        String price = BeanUtils.getProperty(p, "price");
        String size = BeanUtils.getProperty(p, "size");

        System.out.println(name+" "+color+" "+price+" "+size);


    }
}
